home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / text / misc / mpage.lha / mpage / Contrib / mfix / mfix.c next >
Encoding:
C/C++ Source or Header  |  1999-07-25  |  784 b   |  44 lines

  1. #include <stdio.h>
  2.  
  3. FILE *in=stdin,*out=stdout;
  4. char line[200]; line2[200];
  5.  
  6. int
  7. strcp(st1,st2)
  8. char *st1,*st2;
  9.   int n;
  10.   n=strncmp(st1,st2,strlen(st2));
  11.   return(n);
  12. }
  13.  
  14. main()
  15. {
  16.   int i;
  17.   for(i=0; i<10; i=1)
  18.   {
  19.     if (fgets(line,200,in)==NULL) { close(in); close(out); exit(1); }
  20.     if (strcp(line,"%%BeginSetup")==0) 
  21.     { 
  22.       fgets(line,200,in);
  23.       fgets(line,200,in);
  24.       continue;
  25.     }
  26.     if (strcp(line,"%%PageBoundingBox: (at")==0) 
  27.     {
  28.       fprintf(out,"BeginDviLaserDoc\n"); 
  29.       fprintf(out,"300 300 RES\n");
  30.       fprintf(out,"%s",line);
  31.       continue;
  32.     }
  33.     if (strcp(line,"%%PageBoundingBox:")==0) 
  34.     { 
  35.       fprintf(out,"%s",line);
  36.       fprintf(out,"EndDviLaserDoc\n");
  37.       continue;
  38.     }
  39.       
  40.     fprintf(out,"%s",line);
  41.   }
  42. }
  43.